package com.maxmlr.mooncloud.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author maxiao
 * @ClassName TestController
 * @Description //TODO $
 * @Date $ $
 * @desc
 **/
@RestController
public class TestController {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("test1")
    public String getTest() {
        return "test1";
    }


    @RequestMapping("test2")
    public String getTest2() {
        return restTemplate.getForObject("http://eureka-service/test", String.class);
    }

}
